home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / tools / czesc_2 / ixg06d / docs / ixclient_1.rexx < prev    next >
OS/2 REXX Batch file  |  1982-07-25  |  2KB  |  104 lines

  1. /* Sample arexx client program for iX-Guide. */
  2. /* This client receives all events available */
  3. /* from iX-Guide and prints message on every */
  4. /* event                                     */ 
  5.  
  6. if show('p',"IXCL_1") then exit
  7.  
  8. if ~show('l', "rexxsupport.library") then
  9.     addlib('rexxsupport.library',0,-30,0)
  10.  
  11. OPTIONS RESULTS
  12.  
  13. ADDRESS IXGUIDE
  14. ADDCLIENT
  15. portname='IXCL_1'
  16. call openport(portname)
  17. setport portname KEYBOARD MOUSE MISC VGUPDATE
  18. AllocRaster 1
  19. rp=result
  20. Refresh rp
  21.  
  22. Move rp 0 10
  23. shutdown=0
  24. yc=10
  25. do until shutdown
  26.  call waitpkt(portname)
  27.  msg = getpkt(portname)
  28.  
  29.  if msg ~= '0000 0000'x then do
  30.   cmd = getarg(msg)
  31.   
  32.   if cmd='MOUSE' then do
  33.    a1=getarg(msg,1)
  34.    a2=getarg(msg,2)
  35.    a3=getarg(msg,3)
  36.    say 'MOUSE EVENT [ROBJ='a1',X='a2',Y='a3']'
  37.    if a1=1 then do
  38.     Move rp a2 a3
  39.     SetABPen rp 2 1
  40.     Text rp 'Arexx'
  41.    end
  42.   end
  43.   
  44.   if cmd='KEYBOARD' then do
  45.    a4=getarg(msg,1)
  46.    if a4='RAWKEY' then do
  47.     a1=getarg(msg,2)
  48.     a2=getarg(msg,3)
  49.     say 'KEYBOARD EVENT Rawkey ['a1':'a2']'
  50.    end
  51.    else do
  52.     a1=getarg(msg,2)
  53.     say 'KEYBOARD EVENT Vanilla ['d2c(a1)']'
  54.     if a1=13 then do
  55.      yc=yc+10
  56.      Move rp 0 yc
  57.     end
  58.     if a1=32 then Text rp '" "'
  59.     SetABPen rp 1 0
  60.     Text rp d2c(a1)
  61.    end
  62.   end
  63.   
  64.   if cmd='VGUPDATE' then do
  65.    a1=getarg(msg,1)
  66.    a2=getarg(msg,2)
  67.    say 'VGUPDATE EVENT Left 'a1' Top 'a2
  68.   end
  69.   
  70.   if cmd='MISC' then do
  71.    a4=getarg(msg,1)
  72.    if a4='QUIT' then do
  73.     shutdown=1
  74.     say 'QUIT EVENT'
  75.    end
  76.    if a4='WINRESIZED' then
  77.    say 'WINRESIZED EVENT'
  78.    if a4='LINKREQ' then do
  79.     a5=getarg(msg,2)
  80.     say 'LINK REQUESTED Name ['a5']'
  81.    end
  82.    if a4='LINKOK' then do
  83.     a5=getarg(msg,2)
  84.     a6=getarg(msg,3)
  85.     say 'LINK SUCCEDED Database name ['a5'] Node name ['a6']'
  86.    end
  87.    if a4='LINKFAILED' then do
  88.    a5=getarg(msg,2)
  89.    a6=getarg(msg,3)
  90.    say 'LINK FAILED EVENT Database name ['a5'] Node name ['a6']'
  91.    end
  92.    if a4='ASKSCREEN' then say 'User asked for new screen'
  93.    if a4='NEWSCREEN' then say 'Screen changed !'
  94.    if a4='OLDSCREEN' then say 'New screen failed...'
  95.   end
  96.  
  97.   call reply(msg,0)
  98.  end
  99. end
  100.  
  101. FreeRaster rp
  102. RemClient
  103. call closeport(portname)
  104.